Skip to content

Instantly share code, notes, and snippets.

-- based on https://gist.github.com/IntrovertedMage/d759ff214f799cfb5e1f8c85daab6cae and https://gist.github.com/sebdelsol/eba2e492473ac1f9e0ecb003d403b7de
-- Menu added in the Reader menu:
-- settings > Status bar > Progress bar > Thickness, height & colors > Read color
-- settings > Status bar > Progress bar > Thickness, height & colors > Unread color
local ReaderFooter = require("apps/reader/modules/readerfooter")
local ProgressWidget = require("ui/widget/progresswidget")
local BD = require("ui/bidi")
local Blitbuffer = require("ffi/blitbuffer")
local Geom = require("ui/geometry")
@leandronsp
leandronsp / pair.md
Created March 26, 2026 04:43
[SKILL] Pair with Claude
name pair
description TDD pair programming with mode switching. Claude can be driver (writes code) or navigator (watches, questions, provokes). Supports GitHub/Linear issues, file watching, or arbitrary prompts. Scientific TDD, baby steps, one test at a time. Trigger on phrases like "pair", "let's pair", "pair with me", "tdd", "you drive", "I'll drive", "pair program", "dojo".

Pair — TDD Pair Programming

Two modes, one skill. Switch anytime.

  • Driver mode — Claude writes code, user navigates
@romainl
romainl / grep.md
Last active March 27, 2026 00:39
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@zaru
zaru / テストケース生成.txt
Created March 23, 2026 00:48
AIテストコードプロンプト例
以下の実現したいことに基づいて、この機能を実現する関数の正しさを検証するための網羅的なテストケースをVitestで生成しテストファイルを作成・更新してください。テストコードや実装コードはまだ書かず、テストケースのみを出力してください。エッジケースや制約条件がしっかりテストされているか確認できるように、各テストメソッドには意図がわかるコメントを添えてください。もし、仕様やデータフローが不明瞭であれば都度ユーザに聞いて下さい。
[出力要件]
実際のテストロジック(arrangeやモックの実装など)は絶対に書かないでください。
代わりに Vitest の describe と it.todo を使用して、テストの階層構造とケース名のみを定義してください。
テストケース名(it.todoの引数)は、それ自体が「生きたドキュメント(仕様書)」となるよう、「〜の時、〜であること」と振る舞いが明確にわかる日本語で記述してください。
モック利用を前提としたテストケースは作らないこと
[実現したいこと]
@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 27, 2026 00:25
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@akey7
akey7 / hacker-speak.js
Created September 12, 2018 21:28
const hs3 = (orig, replacements = {'a': '4', 'e': '3', 'i': '1', 'o': '0'}) => (
Object
.entries(replacements)
.reduce((acc, el) => acc.replace(el[0], el[1]), orig)
)
console.log(hs3('life'))
console.log(hs3('air'))
console.log(hs3('none'))
console.log(hs3('javascript'))
@ewertonxyz
ewertonxyz / tabledatagateway.md
Created June 3, 2015 12:19
Banco de Dados: Table Data Gateway

Banco de dados: Table Data Gateway

O Table Data Gateway é uma interface que provê a comunicação com o banco de dados de modo a executar operações de inserção, alteração, exclusão e leitura de registros vindos do banco de dados. A sua implementação ocorre através de uma interface que implementa uma classe para persistência de dados e com métodos especificos para essa finalidade.

Esse pattern consegue através de uma instância da classe manipular todas as informações referentes a tabela em questão, vale lembrar que cada uma das instâncias corresponde à uma tabela do banco de dados.

Implementando...

Antes de mais nada, vamos criar uma tabela no banco de dados com a seguinte especificação:

+-------------------+------------+--------+----+

| Campo | Tipo | Tamanho| PK |

@evanreichard
evanreichard / pwa-everything.user.js
Created January 1, 2022 21:28
pwa-everything.user.js
// ==UserScript==
// @name PWA Everything
// @author Evan Reichard
// @version 0.0.1
// @match *://*/*
// @grant none
// @run-at document-idle
// @noframes
// ==/UserScript==